﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LispInterpretor.HelperClasses;

namespace UnitTests.ParserTests
{
    [TestClass]
    public class TestWhiteSpaceClearing
    {
        [TestMethod]
        public void TestBasicClearing()
        {
            string sampleProgram = @"(+
                                        (* 3 4)
                                        (* 5 5)
                                     )";

            Assert.AreEqual("(+ (* 3 4) (* 5 5))", ParserHelper.ClearWhiteSpace(sampleProgram));
        }

        [TestMethod]
        public void TestNoClearing()
        {
            string sampleProgram = @"(+ (* 3 4) (* 5 5))";

            Assert.AreEqual(sampleProgram, ParserHelper.ClearWhiteSpace(sampleProgram));
        }

        [TestMethod]
        public void TestSpacesBetweenLists()
        {
            string sampleProgram = "( (+ 1 3) (+ 1 5) )";

            Assert.AreEqual("((+ 1 3) (+ 1 5))", ParserHelper.ClearWhiteSpace(sampleProgram));
        }
    }
}
